﻿<?xml version="1.0" encoding="utf-8" ?>
<Database Name="test" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007">
  <Table Name="TestClass1">
    <Type Name="Magiq.Sql.Tests.TestModel.LinqToSqlTestClass1" InheritanceCode="0" IsInheritanceDefault="true">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="AnotherIntProperty" Member="AnotherIntProperty" />
      <Column Name="AnotherStringProperty" Member="AnotherStringProperty" />
      <Column Name="IntProperty" Member="IntProperty" />
      <Column Name="NullableIntProperty" Member="NullableIntProperty" />
      <Column Name="StringProperty" Member="StringProperty" />
      <Column Name="ReferenceId" Member="ReferenceId" />
      <Column Name="Reference2Id" Member="Reference2Id" />
      <Column Name="SelfReferenceId" Member="SelfReferenceId" />
      <Association Member="Reference" IsForeignKey="true" ThisKey="ReferenceId" />
      <Association Member="Reference2" IsForeignKey="true" ThisKey="Reference2Id" OtherKey="Id" />
      <Association Member="SelfReference" Storage="selfReference" IsForeignKey="true" ThisKey="SelfReferenceId" OtherKey="Id" />
      <Column Name="Type" Member="Type" IsDiscriminator="true"/>
      <Type Name="Magiq.Sql.Tests.TestModel.LinqToSqlTestClass1Inheritor" InheritanceCode="1" >
        <Column Name="InheritorProperty" Member="InheritorProperty" />
      </Type>
    </Type>
  </Table>
  <Table Name="TestClass2">
    <Type Name="Magiq.Tests.TestModel.TestClass2">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="StringProperty" Member="StringProperty" />
      <Column Name="IntProperty" Member="IntProperty" />
    </Type>
  </Table>
  <Table Name="TestClass3">
    <Type Name="Magiq.Tests.TestModel.TestClass3">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="Text" Member="Text" />
     </Type>
  </Table>
  <Table Name="CompositePkParent">
    <Type Name="Magiq.Sql.Tests.TestModel.CompositePkParent">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="Prop" Member="Prop" />
      <Column Name="ChildId1" Member="ChildId1" />
      <Column Name="ChildId2" Member="ChildId2" />
      <Association Member="Child" IsForeignKey="true" ThisKey="ChildId1,ChildId2" OtherKey="Id1, Id2" />
    </Type>
  </Table>
  <Table Name="CompositePkChild">
    <Type Name="Magiq.Sql.Tests.TestModel.CompositePkChild">
      <Column Name="Id1" Member="Id1" IsPrimaryKey="true" IsDbGenerated="false" />
      <Column Name="Id2" Member="Id2" IsPrimaryKey="true" IsDbGenerated="false" />
      <Column Name="Prop" Member="Prop" />
    </Type>
  </Table>
  <Table Name="ChildItem">
    <Type Name="Magiq.Sql.Tests.TestModel.ChildItem">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="Name" Member="Name" />
      <Column Name="ParentId" Member="ParentId" />
      <!--<Association Member="Parent" IsForeignKey="false" ThisKey="ParentId" Storage="parent" OtherKey="Id" />-->
    </Type>
  </Table>
  <Table Name="Parent">
    <Type Name="Magiq.Sql.Tests.TestModel.Parent">
      <Column Name="Id" Member="Id" IsPrimaryKey="true" IsDbGenerated="true" />
      <Column Name="Name" Member="Name" />
      <Association Member="Items" IsForeignKey="false" Storage="items" ThisKey="Id" OtherKey="ParentId"/>
    </Type>
  </Table>
</Database>
